package com.billionsfinance.hessian.common.loadbalance;

import java.util.Objects;

/**
 * 分布式环境中的每一个服务资源
 *
 * @fileName: Machine.java
 * @author: WeiHui.Zhang
 * @date: 2016-11-07  11:02
 * @version: v1.0.0
 */
public class MachineResource {

	/**
	 * 服务资源
	 */
	private String serviceURL;

	public MachineResource() {
	}

	public MachineResource(String serviceURL) {
		this.serviceURL = serviceURL;
	}

	public String getServiceURL() {
		return serviceURL;
	}

	public void setServiceURL(String serviceURL) {
		this.serviceURL = serviceURL;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		MachineResource that = (MachineResource) o;
		return Objects.equals(serviceURL, that.serviceURL);
	}

	@Override
	public int hashCode() {
		return Objects.hash(serviceURL);
	}

	@Override
	public String toString() {
		return "MachineResource{" +
				"serviceURL='" + serviceURL + '\'' +
				'}';
	}
}
